﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PitBullBusinessLogic.Configuration;


namespace PitBull.Payment.Payson
{
    public class PaysonPaymentSettings
    {
        /// <summary>
        /// Gets or sets the payment server URL
        /// </summary>
        public static string ServerUrl
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.Payson.HostedPayment.ServerUrl", "https://www.payson.se/merchant/default.aspx");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.ServerUrl", value);
            }
        }

        /// <summary>
        /// Gets or sets the payment server URL
        /// </summary>
        public static string SandboxServerUrl
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.Payson.HostedPayment.SandboxServerUrl", "https://www.payson.se/testagent/default.aspx");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.SandboxServerUrl", value);
            }
        }

        /// <summary>
        /// Gets or sets the Seller email
        /// </summary>
        public static string SellerEmail
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.Payson.HostedPayment.SellerEmail", "changethis@email.com");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.SellerEmail", value);
            }
        }

        /// <summary>
        /// Gets or sets the AgentID
        /// </summary>
        public static string AgentID
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.Payson.HostedPayment.AgentID", "");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.AgentID", value);
            }
        }

        /// <summary>
        /// Gets or sets the MD5 key
        /// </summary>
        public static string MD5Key
        {
            get
            {
                return SettingManager.GetSettingValue("PaymentMethod.Payson.HostedPayment.MD5Key", "");
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.MD5Key", value);
            }
        }

        /// <summary>
        /// Gets or sets the PaysonGuarantee
        /// </summary>
        public static bool PaysonGuarantee
        {
            get
            {
                return SettingManager.GetSettingValueBoolean("PaymentMethod.Payson.HostedPayment.PaysonGuarantee", false);
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.PaysonGuarantee", value.ToString());
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the test mode is enabled
        /// </summary>
        public static bool UseSandbox
        {
            get
            {
                return SettingManager.GetSettingValueBoolean("PaymentMethod.Payson.HostedPayment.UseSandbox", true);
            }
            set
            {
                SettingManager.SetParam("PaymentMethod.Payson.HostedPayment.UseSandbox", value.ToString());
            }
        }
    }
}
